<template>
  <div class="detail">
    <el-breadcrumb>
      <el-breadcrumb-item :to="{path:'/'}">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{path:'/complaint/list'}">投诉列表页</el-breadcrumb-item>
      <el-breadcrumb-item >投诉详情页</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="main">
      <h1 style="font-size: 32px;">{{ title }}</h1>
      <div class="publish">
        <span style="color: #333;font-size: 14px;">投诉时间：</span>
        <span style="color: #666;font-size: 14px;">{{ publishDataTime }}</span>
      </div>
      <div class="bidStatus">
        <span v-if="bidStatus == 0" style="color: #ff8200;">正在处理中</span>
        <span v-else>处理完成</span>
      </div>
      <div class="bidContent" ref="bidContent" style="text-align: left;"></div>
      <div class="download">
        <ul>
          <template v-for="item in fileList">
            <li @click="downFile(item.fileName)">
              <span>附件：</span>
              <span>{{ item.fileName }}</span>
            </li>
          </template>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import {getComplaint} from '@/api/bid/complaint'
import {download} from '@/utils/neu'

export default {
  name: "detail",
  methods: {
    downFile(fileName){
      download(fileName)
    }
  },
  data() {
    return {
      id:null,
      title:'',
      publishDataTime:'',
      bidStatus:'',
      content:'',
      fileList:[],
    }
  },
  async created() {
    this.id=this.$route.query.id
    getComplaint(this.id).then(res=>{
      this.title = res.data.title
      this.publishDataTime = res.data.title
      this.bidStatus = res.data.status
      this.content = res.data.content
      this.$refs.bidContent.innerHTML = this.content
      this.fileList = res.data.filesList
    })
  },
  mounted() {
    
  },

}
</script>

<style lang="scss" scoped>
.download{
    ul{
      li{
        text-align: left;
        list-style: none;
        font-size: 14px;
        color: gray;
      }

      li:hover{
        color: #17c2aa;
        cursor: pointer;
      }
    }
  }
</style>
